/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package databaseproject;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Rohit Chand
 */
public class selectQuery extends DatabaseProject {
    
    DatabaseProject db;
   // ResultSet rs;
    
    public selectQuery() throws SQLException
    {
        db = new DatabaseProject(); 
    }//end Constructor selectQuery
    
    
  /**
   * This 
   */
    public ResultSet selectQuerySoftware()
    {
        ResultSet rs= null;
        try {
            Statement stmt = db.connection.createStatement();
            
             rs = stmt.executeQuery("Select * from rohit.products where catalog_id = 1");
            
        } catch (SQLException ex) {
            Logger.getLogger(selectQuery.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs; 
    }// selectQueryProduct()
    
    
    public ResultSet selectQueryHardware()
    {
        ResultSet rs= null; 
        try {
            Statement stmt = db.connection.createStatement();
            
            rs = stmt.executeQuery("Select * from rohit.product where catalog_id = 2");
        } catch (SQLException ex) {
            Logger.getLogger(selectQuery.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs; 
    }
    
    
    
}//end class selectQuery 
